package com.accp.vehiclecare.biz.hzbiz;

import com.accp.vehiclecare.dao.hzdao.EnginetypeMapper;
import com.accp.vehiclecare.dao.hzdao.IncometypeMapper;
import com.accp.vehiclecare.dao.hzdao.ServiceitemMapper;
import com.accp.vehiclecare.dao.hzdao.ServiceitemtypeMapper;
import com.accp.vehiclecare.pojo.Enginetype;
import com.accp.vehiclecare.vo.hzvo.Incometype;
import com.accp.vehiclecare.vo.hzvo.Serviceitem;
import com.accp.vehiclecare.vo.hzvo.Serviceitemtype;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HzBiz {
    //品牌
    @Autowired(required = false)
    private EnginetypeMapper Engdao;
    //维修项目
    @Autowired(required = false)
    private ServiceitemtypeMapper ss;
    //详细维修内容
    @Autowired(required = false)
    private ServiceitemMapper serviceitemMapper;
    //收入种类
    @Autowired(required = false)
    private IncometypeMapper incometypeMapper;
    //查询所有品牌
    public PageInfo<Enginetype> showListpp(Integer PageNum,Integer PageSiz){ PageHelper.startPage(PageNum,PageSiz);
    return new PageInfo<Enginetype>(Engdao.ShowList());}

    //选中删除的品牌
    public int RemovePP(Integer id){return Engdao.DeletePP(id);}

    //添加品牌
    public int AddPP(Enginetype enginetype){return Engdao.AddPP(enginetype);}

    //单个id条件查询品牌
    public Enginetype QueryOnepp(Integer id){return  Engdao.QueryOnePP(id);}

    //单个条件修改品牌
    public int updatepp(Enginetype enginetype ,Integer id){return  Engdao.update(enginetype,id);};

    //主详查询维修项目
    public List<Serviceitemtype> Query(){return ss.queryZ();}

    //条件查询维修项目内容
   public List<Serviceitem> QueryServiceitembyid(Integer id){return serviceitemMapper.query(id);}

    //id删除维修项目信息
    public int DeleteServiceitem(Integer id){return serviceitemMapper.DeleteServiceitem(id);}

    //下拉框选项渲染收入种类
    public List<Incometype> list(){return incometypeMapper.list();}

    //添加维修项目内容
    public int addServiceitem(Serviceitem serviceitem){return serviceitemMapper.addServiceitem(serviceitem);}

    //根据id查找相对应的维修信息
    public Serviceitem QueryOneServiceitem(Integer id){return serviceitemMapper.QueryOneserviceitem(id);};

    //根据id修改维修内容
    public int updateOneServiceitem(Serviceitem serviceitem,Integer id){return serviceitemMapper.updateOneserviceitem(serviceitem,id);}

}
